<?php defined('IN_LK') or die('Access Denied');?>
<?php include self::admin_t('header', 'admin');?>

<form action="?m=member&c=member_group&a=<?php if(isset($ac)){?>edit<?php }else{?>add<?php }?>" method="post" id="myform">
<?php if(isset($ac)){?><input type="hidden" name="info[groupid]" id="groupid" value="<?php echo $info['groupid'];?>" /><?php }?>
  <dl class="form_list">
    <fieldset>
      <legend>基本信息</legend>
      <dd><span class="left w15">会员组名称</span>
        <input type="text" class="input" name="info[name]" id="name" size="25" value="<?php echo isset($info['name']) ? $info['name'] : '';?>" />
      </dd>
      <dd><span class="left w15">积分上限</span>
        <input type="text" class="input" name="info[point]" id="point" size="10" value="<?php echo isset($info['point']) ? $info['point'] : 10;?>" />
      </dd>
    </fieldset>
    <fieldset>
      <legend>高级信息</legend>
      <dd><span class="left w15">用户权限</span>
        <input type="checkbox" name="info[allowpost]" id="allowpost" value="1" <?php echo isset($info['allowpost']) && $info['allowpost'] ? 'checked="checked"' : ''?> />
        <label for="allowpost">允许发布信息</label>
        <input type="checkbox" name="info[allowattachment]" id="allowattachment" value="1" <?php echo isset($info['allowattachment']) && $info['allowattachment'] ? 'checked="checked"' : ''?>/>
        <label for="allowattachment">允许上传附件</label>
        <input type="checkbox" name="info[allowsearch]" id="allowsearch" value="1" <?php echo isset($info['allowsearch']) && $info['allowsearch'] ? 'checked="checked"' : ''?>/>
        <label for="allowsearch">允许搜索</label>
        <input type="checkbox" name="info[allowmessage]" id="allowmessage" value="1" <?php echo isset($info['allowmessage']) && $info['allowmessage'] ? 'checked="checked"' : ''?>/>
        <label for="allowmessage">允许发送短消息</label>
      </dd>
      <dd> <span class="left w15">日最大发布信息</span>
        <input type="text" class="input" name="info[maxposts]" id="maxposts" value="<?php echo isset($info['maxposts']) ? $info['maxposts'] : 0;?>" size="10" />
      </dd>
      <dd> <span class="left w15">日最大短消息数</span>
        <input type="text" class="input" name="info[maxmessages]" id="maxmessages" value="<?php echo isset($info['maxmessages']) ? $info['maxmessages'] : 0;?>" size="10" />
      </dd>
      <dd><span class="left w15">描述</span>
      <textarea name="info[description]" id="description" cols="40" rows="4"><?php echo isset($info['description']) ? $info['description'] : '';?></textarea>
      </dd>
    </fieldset>
    <input class="none" type="submit" id="dosubmit" name="dosubmit" value="提交" />
  </dl>
</form>
</body></html><script type="text/javascript">
<!--
$(function()
{
	$.formValidator.initConfig({autotip:true,formid:"myform",onerror:function(msg){}});
	$("#name").formValidator({onshow:"请输入会员组名。",onfocus:"会员组名2-10字之间"}).inputValidator({min:2,max:10,onerror:"会员组名2-10字之间"}).regexValidator({regexp:"ps_username",datatype:"enum",onerror:"会员组名格式错误"}).ajaxValidator({
			type : 'get',
			url  : '',
			data :"m=member&c=member_group&a=checkname_ajax<?php echo isset($ac) ? '&not=' . $info['groupid'] : ''?>",
			datatype : "html",
			async:'false',
			success : function(data){return data == '1' ? true : false;},
			buttons: $("#dosubmit"),
			onerror : "会员组名已存在",
			onwait : "请稍候..."})<?php if(isset($ac)){?>.defaultPassed()<?php }?>;
	$('#point').formValidator({onshow:'请输入积分上限。',onfocus:'积分上限为1-8位数字'}).regexValidator({regexp:"^\\d{1,8}$",onerror:"积分上限为1-8位数字"});
	$('#maxposts').formValidator({onshow:'请输入日发布信息数上限。',onfocus:'日发布信息数上限为1-8位数字'}).regexValidator({regexp:"^\\d{1,8}$",onerror:"日发布信息数上限为1-8位数字"});
	$('#maxmessages').formValidator({onshow:'请输入日短消息数上限。',onfocus:'日短消息数上限为1-8位数字'}).regexValidator({regexp:"^\\d{1,8}$",onerror:"日短消息数上限为1-8位数字"});
	$('#description').formValidator({onshow:'请输入会员组描述',onfocus:'请输入会员组描述'}).inputValidator({min:1, max:999,onerror:'会员组描述不能为空'});
});
// -->
</script>